<?php
	require_once("db_connection.php");
	
	if(isset($_POST['username'])){
		$username = mysql_real_escape_string($_POST['username']);
		
		$result = mysql_query("SELECT user FROM user WHERE user='$username'", $con);
		
		$count = mysql_num_rows($result);
		
		if($count){
			echo '1';
		}else{
			echo '0';
		}
	}
	
	mysql_close($con);
?>